<?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:72:"D:\phpStudy\WWW\tp57cai\public/../application/admin\view\menu\index.html";i:1498641188;s:75:"D:\phpStudy\WWW\tp57cai\public/../application/admin\view\public\header.html";i:1498611601;s:81:"D:\phpStudy\WWW\tp57cai\public/../application/admin\view\public\index_footer.html";i:1498611601;s:75:"D:\phpStudy\WWW\tp57cai\public/../application/admin\view\public\footer.html";i:1489712748;}*/ ?>

<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title> 后台中心</title>
	<link rel="stylesheet" href="/admin/basic/css/pintuer.css">
    <link rel="stylesheet" href="/admin/basic/css/admin.css">
    <script src="/js/jquery-3.1.1.min.js"></script>
    <script src="/admin/basic/js/pintuer.js"></script>
	<script src="/js/layer/layer.js"></script>
	<script src="/js/my.js"></script>
	  
</head>


</head>
<body>

<div class="panel admin-panel">
  <div class="panel-head"><strong class="icon-reorder"> 菜单列表</strong></div>

	<div class="padding border-bottom">
		<a class="button border-yellow" href="<?php echo U('menu/add'); ?>"><span class="icon-plus-square-o"></span>添加</a>
	</div>
  <table id="content_table" class="table table-hover text-left">
	<tr>
      <th>ID</th>
      <th> 菜单名称</th>
     <th>排序</th>
	 <th>状态</th>
      <th>操作</th>
    </tr>

	  <?php echo $data; ?>
   
  </table>
  <input type="hidden" id="ajax_display" value="" />
</div>
 
<script type="text/javascript">
	function del(ids){
	  $("#ax_"+ids).parent().parent().attr('id','del_tr'+ids);
		if(ids==''){
			layer.msg('参数不能为空',{icon:2});
		}else{

			layer.confirm('您确定要删除吗？', {
				btn: ['确定','取消'] //按钮
			}, function(){
				$.ajax({
					type:"get",
					url:"<?php echo U('menu/ajaxDelete'); ?>",
					data:{id:ids},
					dataType:'json',
					success:function(data){
						if(data.res==1){
							layer.msg(data.msg, {icon:1}, function(){
								$("#content_table").find("#del_tr"+ids).remove();
							});
						}else{
							layer.msg(data.tip,{icon:2});
						}
					}
				});
			}, function(){
			});
		}
	}

	function ajax_display(id){
		  $.ajax({
				type:"get",
				url:"<?php echo U('menu/ajaxShow'); ?>",
				data:{id:id},
				dataType:'json',           
				success:function(data){
					layer.msg(data.msg);
					if(data.res==1){
						$('#dis_'+id).html(data.data.name);
					}else{
						layer.msg(data.msg);
					}
					
				}        
			 });       
	}
 </script>

<input type="hidden" id="del_url" value=" " />

</body>
</html>
